package com.nbsaas.boot.order.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.time.LocalDateTime;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "订单物流", model = "订单物流")
@Entity
@Table(name = "bs_order_logistics")
@Comment("订单物流表")
public class OrderLogistics extends AbstractEntity {

    @Comment("订单ID")
    @FormField(title = "订单ID", sortNum = "1", grid = true, required = true)
    @Column(name = "order_id", nullable = false)
    private Long orderId;

    @Comment("订单编号")
    @FormField(title = "订单编号", sortNum = "2", grid = true, required = true)
    @Column(name = "order_no", nullable = false, length = 64)
    private String orderNo;

    @Comment("物流公司")
    @FormField(title = "物流公司", sortNum = "3", grid = true, required = true)
    @Column(name = "logistics_company", nullable = false, length = 50)
    private String logisticsCompany;

    @Comment("物流公司编码")
    @FormField(title = "物流公司编码", sortNum = "4", grid = true)
    @Column(name = "logistics_company_code", length = 20)
    private String logisticsCompanyCode;

    @Comment("物流单号")
    @FormField(title = "物流单号", sortNum = "5", grid = true, required = true)
    @Column(name = "tracking_number", nullable = false, length = 50)
    private String trackingNumber;

    @Comment("物流状态")
    @FormField(title = "物流状态", sortNum = "6", grid = true, type = InputType.select)
    @Column(name = "logistics_status", nullable = false)
    private Integer logisticsStatus = 0;

    @Comment("发货时间")
    @FormField(title = "发货时间", sortNum = "7", type = InputType.date, grid = true)
    @Column(name = "shipping_time")
    private LocalDateTime shippingTime;

    @Comment("签收时间")
    @FormField(title = "签收时间", sortNum = "8", type = InputType.date, grid = true)
    @Column(name = "delivery_time")
    private LocalDateTime deliveryTime;

    @Comment("物流信息")
    @FormField(title = "物流信息", sortNum = "9", type = InputType.textarea)
    @Column(name = "logistics_info", columnDefinition = "text")
    private String logisticsInfo;
} 